<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <div class="container container-fluid">
	<h2 id="btn-groups-sizing">用户管理</h2>
	<div class="row">
			<div class="col-sm-12 portfolio-item">
				<table class="table table-hover">
			  		<thead>
			  			<tr>
				  			<th>序号</th>
				  			<th>用户名</th>
				  			<th>管理权限</th>
				  			<th>删除</th>
			  			</tr>
			  		</thead>
			  		<tbody>
			  			<c:forEach items="${users }" var="item" varStatus="status">
				  			<tr>
						  		<td>${status.index }</td>
						  		<td>${item.username }</td>
						  		<td><a href="${pageContext.request.contextPath}/manage/user/detail?id=${item.id}">权限管理</a></td>
						  		<td><a href="${pageContext.request.contextPath}/manage/user/del?id=${item.id}">删除</a></td>
					  		</tr>
			  			</c:forEach>
			  		</tbody>
				</table>
			</div>
		</div>
    <div>
      <nav class="pagination">
	  <ul class="pagination">
	  <% 
	  	int index = Integer.valueOf(request.getAttribute("index").toString());
	  	int count = Integer.valueOf(request.getAttribute("count").toString());
	  	for(int i=1;i<=count;i++){
	  		if(i==index){
	  			%>
			    <li class="active"><a href="${pageContext.request.contextPath}/manage/user/users?index=<%=i %>"><%=i %></a></li>
	  			<%
	  		}else{
	  			%>
			    <li><a href="${pageContext.request.contextPath}/manage/user/users?index=<%=i %>"><%=i %></a></li>
	  			<%
	  		}
	  	}
	  %>
	  </ul>
	</nav>
    </div>
</div><!--/span-->
   